<?php
 /**
  * This is used for building the URLs for the Our Work Side Nav items
  * Used in with the List By % Views
  *
  * This template is used to print a single field in a view. It is not
  * actually used in default Views, as this is registered as a theme
  * function which has better performance. For single overrides, the
  * template is perfectly okay.
  *
  * Variables available:
  * - $view: The view object
  * - $field: The field handler object that can process the input
  * - $row: The raw SQL result that can be used
  * - $output: The processed output that will normally be used.
  *
  * When fetching output from the $row, this construct should be used:
  * $data = $row->{$field->field_alias}
  *
  * The above will guarantee that you'll always get the correct data,
  * regardless of any changes in the aliasing that might happen if
  * the view is modified.
  */
  global $base_url;
  $tid = $row->tid;
  $term = $row->taxonomy_term_data_name;
  if(isset($_GET['term'])){
  	$activeTID = $_GET['term'];
  }else{
  	$activeTID = arg(2);
  }
?>

<a href="<?php print $base_url;?>/<?php print drupal_get_path_alias('taxonomy/term/'.$row->tid); ?>"<?php if ($activeTID == $row->tid):?>class="active"<?php endif;?>><?php print $row->taxonomy_term_data_name; ?></a>